package com.zonda.study.opengl.image;

import android.app.Activity;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.support.annotation.Nullable;

/**
 * Created by zhuqiuzhu on 17/3/24.
 * 绘制图片示例的入口类
 */

public class GLSurfaceViewActivity extends Activity {

    private GLSurfaceView mGLSurfaceView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.gl_surface_main_layout);
        mGLSurfaceView = (GLSurfaceView) findViewById(R.id.gl_surface_view);

//        mGLSurfaceView.setEGLConfigChooser();

        //确保兼容 OpenGL 2.0
        mGLSurfaceView.setEGLContextClientVersion(2);
        mGLSurfaceView.setRenderer(new ImageRenderer(this));
    }

    @Override
    protected void onResume() {
        super.onResume();
        mGLSurfaceView.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        mGLSurfaceView.onPause();
    }
}
